<style>
    body {
        background: url(background.jpg)
    }
</style>
<img id="pic" src="https://xn--rhq706du3i.top/cc/images/1.png" style="position:absolute;right:300px;top: 30px;" />
<script>
    var i = 1;

    var j = 300;
    var z = 30;

    function f() {
        j += 5;
        if (i == 32) i = 1;
        pic.src = "https://xn--rhq706du3i.top/cc/images/"+i+".png";
        i++;
        if (j <= 1000 && z == 30) {
            document.getElementById("pic").style.right = j + "px";

        } else if (z < 401) {
            j = 1000;
            z += 5;
            document.getElementById("pic").style.top = z + "px";
        } else {
            z = 401;
            j -= 10;
            document.getElementById("pic").style.right = j + "px";
        }
    }
    setInterval(f, 50);
</script>